package com.ydt.controller;

import com.ydt.entity.YdtShoppingcart;
import com.ydt.service.YdtShoppingcartService;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (YdtShoppingcart)表控制层
 *
 * @author makejava
 * @since 2020-12-24 16:47:07
 */
@RestController
@RequestMapping("ydtShoppingcart")
public class YdtShoppingcartController {
    /**
     * 服务对象
     */
    @Resource
    private YdtShoppingcartService ydtShoppingcartService;

    /**
     * 通过主键查询单条数据
     *

     * @return 单条数据
     */

    @PostMapping("insert")
    public YdtShoppingcart insert(@RequestBody YdtShoppingcart ydtShoppingcart)
    {

        return ydtShoppingcartService.insert(ydtShoppingcart);
    }
    @PostMapping("all")
    public List<YdtShoppingcart> all(@RequestBody YdtShoppingcart ydtShoppingcart){

        return  ydtShoppingcartService.queryById(ydtShoppingcart);
    }
    @GetMapping("sel")
    public List<YdtShoppingcart> sel(){

        return  ydtShoppingcartService.sel();
    }
        @PostMapping("update")
    public int update(@RequestBody YdtShoppingcart ydtShoppingcart){

        return  ydtShoppingcartService.update(ydtShoppingcart);
    }
@PostMapping("insertOrUpdateBatch")
    public  int insertOrUpdateBatch(@RequestParam List<YdtShoppingcart> ydtShoppingcarts){

        return ydtShoppingcartService.insertOrUpdateBatch(ydtShoppingcarts);
}
    @PostMapping("update0")
    public int update0(@RequestBody YdtShoppingcart ydtShoppingcart){

        return  ydtShoppingcartService.update0(ydtShoppingcart);
    }
    @PostMapping("update1")
    public int update1(@RequestBody YdtShoppingcart ydtShoppingcart){

        return  ydtShoppingcartService.update1(ydtShoppingcart);
    }
    @PostMapping("delete")
    public int delete(@RequestBody YdtShoppingcart ydtShoppingcart){

        return  ydtShoppingcartService.delete(ydtShoppingcart);
    }
}
